<template>
  <xue-form-box class="xue-sf-tp-form" :formData="formData" ref="formBox">
    <which-component
      v-for="li in formData.formDataList"
      :key="li.fieldId"
      :data="li"
      type="ShowForm"
      :prop="li.fieldId"
      :model="formData.model"
    ></which-component>
  </xue-form-box>
</template>

<script>
import WhichComponent from '../componentList/WhichComponent'
import XueFormBox from '../componentList/common/FormBox'
export default {
  name: 'XueForm',
  components: { WhichComponent, XueFormBox },
  provide() {
    return {
      formData: this.formData,
    }
  },
  props: {
    formData: {
      type: Object,
      required: true,
      /**
       * formDataList: [],
       * formStyle: { }
       */
    },
  },
  methods: {
    // 做验证
    doValidateForm() {
      this.$refs['formBox'].doValidateForm()
    },
  },
}
</script>
